import request from '@/config/axios'

export interface RoleVO {
  id: number
  name: string
  code: string
  sort: number
  status: number
  type: number
  dataScope: number
  dataScopeDeptIds: number[]
  createTime: Date
}

export interface UpdateStatusReqVO {
  id: number
  status: number
}

// 获取人员在项目中的角色
export const getProjectMemberRole = async (params) => {
  return await request.get({ url: '/project/member/role', params })
}

// 查询版本列表
export const getVersion = async (params) => {
  return await request.get({ url: '/testdemand/project/version/test', params })
}

// 查询提测列表
export const getPage = async (params) => {
  return await request.get({ url: '/testManager/testForm/formList', params })
}

// 新增提测列表
export const createTest = async (data) => {
  return await request.post({
    headersType: 'multipart/form-data',
    url: '/testManager/testForm/addTestFormBaseInfo', data
  })
}

// 编辑提测列表
export const updateTest = async (data) => {
  return await request.post({
    headersType: 'multipart/form-data',
    url: '/testManager/testForm/editTestFormBaseInfo', data
  })
}

// 查看提测列表
export const viewTest = async (params) => {
  return await request.get({ url: '/testManager/testForm/getTestRequestFormById', params })
}

// 下载附件
export const downloadFile = async (data) => {
  return await request.downloadfile({
    headersType: 'multipart/form-data',
    url: '/testManager/testForm/downloadFile', data
  })
}

//查询需求树
export const getDemandTree = async (params) => {
  return await request.get({
    url: '/testdemand/project/demand/tree', params
  })
}

//获取需求功能点详情
export const getDemandInfo = async (params) => {
  return await request.get({ url: '/testdemand/project/demand/get', params })
}

//审批
export const approveStatus = async (params) => {
  return await request.get({ url: '/testManager/testForm/approve', params })
}

//提交
export const submitStatus = async (params) => {
  return await request.get({ url: '/testManager/testForm/submit', params })
}

// 删除
export const deleteTesting = (id: number) => {
  return request.delete({ url: '/testManager/testForm/deleteTestRequestForm?id=' + id })
}